﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Architecture.CrossCutting.RepositoryPattern.Specification;
using Architecture.Domain.TestModel.Models;
using Architecture.CrossCutting.RepositoryPattern;
using Architecture.Domain.BankManagement.QuerySpecifications;

namespace Architecture.Domain.BankManagement.Repositories
{
    public class CountriesRepository : Repository<Country>
    {
        public CountriesRepository(DbContext context) : base(context)
        {
        }

        public Country GetCountry(String name, String codeISO)
        {
            var specification = CountriesSpecification.ExistingCountry(name, codeISO);
            return this.AllMatching(specification).SingleOrDefault();
        }

    }
}
